package 对象之封装.手机类的定义和使用;

//手机类的定义何使用
public class text {
    public static void main(String[] args) {
        phone p = new phone();
        p.brand = "苹果";
        p.model = "X";
        p.name = "朱丽伟";
        System.out.println(p.brand);
        System.out.println(p.model);
        System.out.println(p.name);
        System.out.println("===============================");

        p.call("测试一号");
        p.send("测试二号");
        p.playgame("测试三号");
    }

    public static class phone {
        String brand;
        String model;
        String name;

        public void call(String name) {
            System.out.println("给" + name + "打电话");
        }

        public void send(String name) {
            System.out.println("发短信给" + name);
        }

        public void playgame(String name) {
            System.out.println("和" + name + "打游戏");
        }

    }


}